<HTML><HEAD><TITLE>current_after_event(?Event)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Obsolete</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>current_after_event(?Event)</H1>
   Check or find currently pending after events (inside handler).


<DL>
<DT><EM>Event</EM></DT>
<DD>Atom or variable
</DD>
</DL>
<H3>This built-in predicate is obsolete!</H3>
<H2>Description</H2>

   If Event is an atom, succeeds if Event is a currently pending after
   event, i.e. an event which is setup by either event_after/2 or
   event_after_every/2, and which is waiting to be raised
   (event_after_every/2 will always be pending as it is raised
   repeatedly). If Event is a variable, then all the currently pending
   events are returned as a list. An event will appear as many times as it
   had been setup. 

<P>
   Note that this predicate can only be called from within an after event 
   handler, i.e. when the timer is paused, and the after event state can be
   safely examined. An error would be raised otherwise.
<P>

<H3>Modes and Determinism</H3><UL>
<LI>current_after_event(+) is semidet
<LI>current_after_event(-) is det
</UL>
<H3>Fail Conditions</H3>
Fails if Event is not a pending after event
<H3>Exceptions</H3>
<DL>
<DT><EM>(1) general error </EM>
<DD>Predicate is called while after events was not frozen.
<DT><EM>(5) type error </EM>
<DD>Event is not an atom or variable.
</DL>
<H2>Examples</H2>
<PRE>
   setup :-
      set_event_handler(hi, hi/0),
      event_after_every(hi, 3.2).

   hi :-
      current_after_event(Es),
      writeln(hi),
      writeln('Pending events'-Es).

   :- setup, repeat, fail.  
   % just spinning after the setup for events to be raised.

</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/event/event_after-2.html">event_after / 2</A>, <A HREF="../../kernel/event/event_after_every-2.html">event_after_every / 2</A>, <A HREF="../../kernel/event/event-1.html">event / 1</A>, <A HREF="../../kernel/event/set_event_handler-2.html">set_event_handler / 2</A>, <A HREF="../../kernel/obsolete/cancel_after_event-1.html">cancel_after_event / 1</A>
</BODY></HTML>
